import React from 'react';
import PropTypes from 'prop-types';
import ThemeContext from '../assets/Theme';
class VoteMain extends React.Component {
	render() {
		return <main>
			<ThemeContext.Consumer>
				{context => {
					// context获取到的上下文中的信息
					let { supNum, oppNum } = context;
					return <>
						<p>支持人数：{supNum}</p>
						<p>反对人数：{oppNum}</p>
					</>;
				}}
			</ThemeContext.Consumer>
		</main>;
	}
}
export default VoteMain;